
public class SemesterAmoedB2011question3 {
	
	public static boolean rec(String s1, String s2){
		boolean answer;
			if (s1.equals("")){
				answer = true;
				return answer;
			}
			if (s2.equals("")){
				answer = false;
				return answer;
			}
			else if (s1.charAt(0) == s2.charAt(0)){
				return rec (s1.substring(1),s2.substring(1));
			}else{
				return rec (s1 , s2.substring(1));
			}


		
		}
	
	public static void main (String[] args){
	System.out.println(rec("abc" , "quarsbecy"));
	System.out.println(rec("abc" , "cba"));
	System.out.println(rec("abbc" , "wababec"));
	System.out.println(rec("abbc" , "wabec"));
	System.out.println(rec("iinea" , "this is an exam"));
	System.out.println(rec("iinea" , "iaina"));
	
		
	}
		

}
